#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>

typedef struct BinaryTreeNode
{
	struct BinaryTreeNode* left;
	struct BinaryTreeNode* right;
	int val;
}BTNode;

#include"Queue.h"

void LevelOrder(BTNode* root)
{
	Que q;
	QueueInit(&q);
	if (root)
		QueuePush(&q, root);
	if (!QueueEmpty(&q))
	{
		BTNode* front = QueueFront(&q);
		printf("%d", front);
		if (front->left)
			QueuePush(&q, front->left);
		if(front->right)
			QueuePush(&q, front->right);
		QueuePop(&q);
	}
	printf("\n");
	QueueDestroy(&q);
}